<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.is.model.ParamCourse"%>
<%@page import="com.is.control.ParamCourseControl"%>
<%@page import="com.is.util.ParamUtil"%>
<%
          String courseName = new String(request.getParameter("courseName_up").getBytes("iso8859-1"),"utf-8");
          String courseNameEn = new String(request.getParameter("courseNameEn_up").getBytes("iso8859-1"),"utf-8");
          String grade = new String(request.getParameter("grade_up").getBytes("iso8859-1"),"utf-8");
          int typeId = Integer.parseInt(grade);
          int  courseId = ParamUtil.getInt(request,"courseId",0);
          if(grade==null){
             typeId=ParamCourseControl.getCourseById(courseId).getTypeId();
          }
          if(courseName==null){
             grade=ParamCourseControl.getCourseById(courseId).getCourseName();
          }
          if(courseNameEn==null){
             grade=ParamCourseControl.getCourseById(courseId).getCourseNameEn();
          }
          //System.out.print("DDD"+grade+"DDD");
          ParamCourse pc = new ParamCourse(courseName,courseNameEn,typeId);
          boolean isSuccess = ParamCourseControl.updateParamCourse(pc,courseId);
    	  String returnJson = "{\"status\":\"" + (isSuccess ?  1 : 0) + "\"}";
%>
 <%=returnJson %>